extends RayCast2D


func _physics_process(_delta):
	if is_colliding():
		var collision_point = to_local(get_collision_point())
		$Line2D.set_point_position(1, collision_point)
		if get_collider() is Player:
			get_tree().reload_current_scene()
	else:
		$Line2D.set_point_position(1, target_position)
